<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="js/jquery.min.js"></script>

<body>
    <button id="btn">发起请求</button>
    <button id="btn2">起请求</button>
    <button id="btn1">请求</button>
    <script>
        $(function () {
            $('#btn').click(function () {
                $.get('http://www.liulongbin.top:3006/api/getbooks', function (data) {
                    console.log(data);
                })
            })
            $('#btn2').on('click', function () {
                $.get('http://www.liulongbin.top:3006/api/getbooks', { id: 86 }, function (res) {
                    console.log(res);
                })
            })
            $('#btn1').on('click', function () {
                $.get('http://www.liulongbin.top:3006/api/getbooks', { bookname: '水浒传', zhuozhen: '施耐庵', chubanshe: '詹天宗图书馆' },
                    function (a) {
                        console.log(a);
                    })
            })
        })
    </script>
</body>

</html>